<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
// import Joomla controller library
jimport('joomla.application.component.controller');
 
/**
 * Retail Shop Component Controller
 */
class RetailShopControllerMainLayout extends JController
{
    function display()
	{
		$mainframe = JFactory::getApplication();
		$model = $this->getModel('RetailShop');
		$countrys = $model->getArrCountry();
		$catagorys = $model->getCategory();
		$eventsAll = $model->getArrAllEvent();
		$defaultcity1 = $model->getShopDefaultCity("1",4);
		$defaultcity2 = $model->getShopDefaultCity("2",4);        
		$defaultnamecity1 = $model->getnamecity("1");        
		$defaultnamecity1 = $defaultnamecity1->name;        
		$defaultnamecity2 = $model->getnamecity("2");   
		$defaultnamecity2 = $defaultnamecity2->name;    		
		$getshop = $model->getallshop(3);    		
		//$lastoffer = $model->
		$latestoffer = $model->getCategory();
		
		//list event in
		$arr = array(4,5,6,7,8,9,10,11,12,13);
		$events = $model->getArrEventAllShop();		
		
		$view = $this->getView('mainlayout','html');
		
		$view->assign('countrys',$countrys);
		$view->assign('catagorys',$catagorys);
		$view->assign('events',$events);
        $view->assign('eventsAll',$eventsAll);
        $view->assign('defaultcity1',$defaultcity1);
        $view->assign('defaultcity2',$defaultcity2);
        $view->assign('defaultnamecity1',$defaultnamecity1);
        $view->assign('defaultnamecity2',$defaultnamecity2);
        $view->assign('getshop',$getshop);
		$view->setLayout('default');
		$view->display();
	}	
}